/*ServiceCMD.java
 * 
 * This command creates a new service and adds it to the
 * collection of services within the tourApp
 *
 * Greg Warner
 * Derek Dupuis
 * Michael Dixey
 * Alex Schwartz
 */

import java.util.*;

public class ServiceCMD extends Cmd
{
    private String type;
    
    public ServiceCMD() 
    { 
        super(); 
    }
    
    // parse command, create service and add to collection in TourApp
    public void exec()
    {
        if( token.length == 2 )
        {
            type = token[ 1 ];
            
            Service newService = new Service( type );        
            
            tourApp.addService( newService );
        }
        else
        {
            System.err.print( "Not enough tokens in command!\n" );
            return;
        }
    }
}